#pragma once
#include "SDLSprite.h"
#include "SDLTime.h"

class SDLScene;

class SDLAnimation: public SDLSprite
{
public:
	SDLAnimation();
	SDLAnimation(int nbFrames, int frameRate, int frameX, int frameY, int width, int height, bool isLooping, bool isHorizontal, std::string fileName);
	SDLAnimation(int nbFrames, int frameRate, int posX, int posY, int frameX, int frameY, int width, int height, bool isLooping, bool isHorizontal, std::string fileName);
	SDLAnimation(int nbFrames, int frameRate, int posX, int posY, int frameX, int frameY, int width, int height, bool isLooping, bool isHorizontal, std::string fileName, SDLScene* _scene);
	~SDLAnimation();

	void Update();
	void SetAnimation(int _nbFrames, int _frameRate, int _posX, int _posY, int _frameX, int _frameY, int _width, int _height, bool _isLooping, bool _isHorizontal);

protected:
	bool isLooping;
	bool isHorizontal;

	int frameWidth;
	int frameHeight;
	int nbFrames;
	int currentFrame;
	
	float frameRate;
	float currentTime;

	SDL_Rect* anim;
	SDL_Surface surface;
};

